class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        size, length = 0, len(nums)
        for j in range(length):
            if nums[j] != val:
                nums[size] = nums[j]
                size+=1
        return size